module('localnotation',package.seeall)  
--添加本地推送
--添加用餐补充体力的推送
local function checktime(starttime,endtime)
		
end
function addLocalNotation() 
  local curtime = os.time();
  local t = os.date("*t");
  local curyear  = t['year'];             --当前年份
  local curmonth = t['month'];            --当前月份
  local curday   = t['day'];             --当前日期 
  local time1 = os.time{year=curyear,month=curmonth,day=curday,hour=11,min=0,sec=0}; 
  local time2 = os.time{year=curyear,month=curmonth,day=curday,hour=17,min=0,sec=0}; 
  local curtime = os.time();
  local inter = 0;
  if curtime < time1 then--午餐
    inter = time1 - curtime; 
  elseif curtime < time2 then--晚餐  
    inter = time2 - curtime;
  else --第2天
    inter = time1 + 24*60*60 - curtime; 
  end 
  print('添加了本地推送')
  c_addNotation('可以用餐了，赶紧去任务那里领取体力吧',inter);
end 
--移除所有推送
function removeLocalNotation()
  print('移除了本地推送')
  c_removeNotation();
end 
 

